<?php
require_once dirname(__FILE__) . '/library/JMessage/autoload.php';
use JMessage\JMessage;
use JMessage\IM\ChatRoom;
use JMessage\IM\User;
use JMessage\IM\Message;
$appKey = '0626807d0689a03628e39e2e';
$masterSecret = '48c6bd659fbaf293a45708f7';
$client = new JMessage($appKey, $masterSecret);
$room = new ChatRoom($client);
$user = new User($client);
//var_dump($response);die;
//$re = $room->create("chartroom", $owner="xiaohu1", $members = [], $description = "");
//$re = $room->create("chartroom", $owner="songxl", $members = ["xiaoh","xiaohua"], $description = "ceshimiaoshu");
//$room->listAll($count, $start = 0);
//$re  = $room->show('23976714');
//$re = $room->addMembers('23976714', ['xiaoh',"songx"]);
//$re =$room->members('23976714', 10, $start = 0);
//$message = new Message($client);
//$message->sendText($version,  $from,  $target,  $msg,  $notification = [], $options = []);
$res = $room->show("23981282");
//$re =$room->members("23981569", 500, $start = 0);
//$re = $room->removeMembers('23978009',  ['xiaohu1']);
//$response = $user->register('ceshi', '123456');//Jmzo281
$re = $user->chatrooms("Jmah479");
var_dump($re);var_dump($res);